@import "../_partial/_single/series";
@import "../_partial/_single/toc";

.single {
  .single-title {
    margin: 1rem 0 0.5rem;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 140%;
  }

  .single-subtitle {
    margin: 0.4rem 0;
    font-size: 1.2rem;
    font-weight: normal;
    font-style: italic;
    line-height: 100%;
  }

  .post-meta {
    font-size: 0.875rem;
    color: $global-font-secondary-color;

    span {
      display: inline-block;
    }

    @include link(false, true);

    .author {
      font-size: 1.05rem;
    }
  }

  .featured-image {
    margin: 0.5rem 0 1rem 0;

    img {
      display: block;
      width: 100%;
      max-width: 100%;
      height: auto;
      margin: 0 auto;
      overflow: hidden;
    }
  }

  .content {
    > h2 {
      font-size: 1.5rem;

      & code {
        font-size: 1.25rem;
      }
    }

    > h3 {
      font-size: 1.375rem;

      & code {
        font-size: 1.125rem;
      }
    }

    > h4 {
      font-size: 1.25rem;

      & code {
        font-size: 1rem;
      }
    }

    > h5 {
      font-size: 1.125rem;
    }

    > h6 {
      font-size: 1rem;
    }

    h2,
    h3,
    h4,
    h5,
    h6 {
      font-weight: $single-h-font-weight;
      margin: 1.2rem 0;
    }

    > h2,
    > h3,
    > h4,
    > h5,
    > h6 {
      > .header-mark::before {
        content: "|";
        margin-right: 0.3125rem;
        color: $single-link-color;
      }
    }

    > h2 > .header-mark::before {
      content: "|";
    }

    p {
      margin: 0.5rem 0;
    }

    b,
    strong {
      font-weight: bold;
      color: $single-content-strong-color;
    }

    @include link(false, false);

    a {
      @include overflow-wrap(break-word);

      & b,
      & strong {
        color: $single-link-color;
      }
    }

    a:hover b,
    a:hover strong {
      color: $single-link-hover-color;
    }

    ul,
    ol {
      margin: 0.5rem 0;
      padding-left: 2.5rem;
    }

    ul {
      list-style-type: disc;
    }

    ruby {
      background: $code-background-color;

      rt {
        color: $global-font-secondary-color;
      }
    }

    .table-wrapper {
      overflow-x: auto;

      > table {
        width: 100%;
        max-width: 100%;
        margin: 0.625rem 0;
        border-spacing: 0;
        background: $table-background-color;
        border-collapse: collapse;

        thead {
          background: $table-thead-color;
        }

        td:nth-child(2).lntd {
          max-width: 0;
          overflow: auto;
          text-overflow: ellipsis;
          white-space: nowrap;
        }

        th,
        td {
          padding: 0.3rem 1rem;
          border: 1px solid $table-border-color;
        }

        th[role="columnheader"]:not(.no-sort) {
          cursor: pointer;
        }

        th[role="columnheader"]:not(.no-sort):after {
          content: "";
          float: right;
          margin: 0.7rem -0.5rem 0px 0.5rem;
          border-width: 0 4px 4px;
          border-style: solid;
          border-color: $global-font-color transparent;

          visibility: hidden;
          opacity: 0;
          -ms-user-select: none;
          -webkit-user-select: none;
          -moz-user-select: none;
          user-select: none;
        }

        th[aria-sort="ascending"]:not(.no-sort):after {
          border-bottom: none;
          border-width: 4px 4px 0;
        }

        th[aria-sort]:not(.no-sort):after {
          visibility: visible;
          opacity: 0.4;
        }

        th[role="columnheader"]:not(.no-sort):hover:after {
          visibility: visible;
          opacity: 1;
        }
      }
    }

    img {
      max-width: 100%;
      min-height: 1em;
    }

    figure {
      margin: 0.5rem;
      text-align: center;

      .image-caption:not(:empty) {
        min-width: 20%;
        max-width: 80%;
        display: inline-block;
        padding: 0.5rem;
        margin: 0 auto;
        font-size: 0.875rem;
        color: #969696;
      }

      img {
        display: block;
        height: auto;
        margin: 0 auto;
        overflow: hidden;
      }
    }

    blockquote {
      display: block;
      border-left: 0.25rem solid $blockquote-color;
      background-color: $blockquote-bg-color;
      padding: 0.25rem 0.75rem;
      margin: 1rem 0;
    }

    .footnotes {
      color: $global-font-secondary-color;

      p {
        margin: 0.25rem 0;
      }

      li {
        scroll-margin-top: 3.5rem;
      }
    }

    .headerLink {
      scroll-margin-top: 3.5rem;
      line-height: 1.2;
    }

    sup {
      scroll-margin-top: 3.5rem;
    }

    @import "../_partial/_single/code";
    @import "../_partial/_single/katex";
    @import "../_partial/_single/admonition";
    @import "../_partial/_single/echarts";
    @import "../_partial/_single/mapbox";
    @import "../_partial/_single/music";
    @import "../_partial/_single/bilibili";
    @import "../_partial/_single/friend";
    @import "../_partial/_single/showcase";
    @import "../_partial/_single/mermaid";

    hr {
      margin: 2rem 0;
      position: relative;
      border-top: 3px dashed $global-border-color;
      border-bottom: none;
    }

    kbd {
      display: inline-block;
      padding: 0.25rem;
      background-color: $global-background-color;
      border: 1px solid $global-border-color;
      border-bottom-color: $global-border-color;
      @include border-radius(3px);
      @include box-shadow(inset 0 -1px 0 $global-border-color);
      font-size: 0.8rem;
      font-family: $code-font-family;
      color: $code-color;
    }

    .version {
      display: inline-block;
      height: 1.25em;
      vertical-align: text-bottom;
    }
  }

  @import "../_partial/_single/footer";
  @import "../_partial/_single/sponsor";
  @import "../_partial/_single/related";
}

.typeit {
  .highlight {
    padding: 0.375rem;
    font-size: 0.875rem;
    font-family: $code-font-family;
    word-break: break-all;
    white-space: pre-wrap;
  }

  --ti-cursor-font-family: #{$global-font-family};
  --ti-cursor-font-size: #{$global-font-size};
  --ti-cursor-font-weight: #{$global-font-weight};
  --ti-cursor-line-height: #{$global-line-height};
  --ti-cursor-color: #{$global-font-secondary-color};
  --ti-cursor-margin-left: 0;
}

.lg-toolbar .lg-icon::after {
  color: #999;
}

#TableOfContents {
  max-height: 75vh;
  overflow: auto;
}
